const defaultState = {
    showAlert: false,
    alertType: "success",
    alertContent: "提示内容!"
}


let reducer = (state = defaultState, action) => {
    let newState = JSON.parse(JSON.stringify(state));

    switch (action.type) {
        case "showAlert":
            newState.showAlert = action.value.showAlert
            newState.alertType = action.value.alertType
            newState.alertContent = action.value.alertContent
            break;
        case "hideAlert":
            newState.showAlert = false
            break;
        default:
            break;
    }
    return newState
}


export default reducer